import {
	computed
} from 'vue
/**
 * @param {Function} fn:传入一个函数
 */
export function usecomputed(fn) {
	const map = new Map();
	return function(...args) {
		const key = ON.stringify(args);
		if (map.has(key)) {
			return map.get(key);
		}
		const result = computed(() => fn(...args))
		map.set(key, result);
		return result;
	}
}